//
//  String+Size.swift
//  AirlineReservation
//
//  Created by Kevin on 2020/1/16.
//  Copyright © 2020 Kevin. All rights reserved.
//

import UIKit

extension String {
    
    func boundingRect(w:CGFloat,h:CGFloat,fontSize:CGFloat) -> CGSize {
        return (self as NSString).boundingRect(with: CGSize(width: w, height: h), options: .usesLineFragmentOrigin, attributes: [NSAttributedString.Key.font : UIFont.systemFont(ofSize: fontSize)], context: nil).size
    }
}
